<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*-----------------------------------------------------------------------------------------------
Load some list Block via AJAX
-----------------------------------------------------------------------------------------------*/
class Get_ajax_list extends Front_Controller{

    function Get_ajax_list(){
        parent::Front_Controller();
        $this->block = new stdClass();
        $this->block->admin_id = $_GET['fid'];
        $this->block->page_id= $_GET['pid'];
        $this->block->style= '';
        
    }
    
    function get_tt_list_ajax(){
        $tid = @$_GET['term_id'];
        $term_list = Modules::run('blocks.get_tt_list', TRUE, $this->block, array($tid, "small"));
        $this->add('term_list', str_replace('actionSelectTT', 'actionSelectTTEnrol', $term_list));
        $this->view('get_tt_list_ajax');
    }
    
    function get_cl_list_ajax(){
        $tid = @$_GET['term_id'];
        $cid = @$_GET['course_id'];
        $clid = @$_GET['class_id'];
        $this->add('class_list', Modules::run('blocks.get_cl_list', TRUE, $this->block, array("small", $tid,'', $cid, $clid)));
        
        $this->view('get_cl_list_ajax');
    }
    
    function get_dynamic_js_ajax(){
        $CI = &get_instance();
        $CI->load->module_library('blocks.dynamiclist');
        $form_name = 'frmEnrol';
        $tid = @$_GET['term_id'];
        $this->add('js', $CI->dynamiclist->get_dynamic_classfromcourse_list_js($this->block->admin_id, $form_name ,$tid, FALSE));
    }
}